﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using CMS.BLL;
using CMS.BLL.Entity;


public partial class Controls_TravelGuide_ctrTravelGuide : System.Web.UI.UserControl
{
    private int nCurrentLang = Support.GetCurrentLanguage();
    private int nDefaultLang = Support.GetDefaultLanguage();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadData();
        }
    }
    private void LoadData()
    {
        int nPageCount=0;
        lblTravelGuide.Text = MultipleLanguage.TRAVELGUIDE[nCurrentLang - 1];
        StaticPages objStatic = new StaticPages ();
        DataTable dtbStatic = new DataTable ();
        dtbStatic = objStatic.Search("",0,5,nDefaultLang,nCurrentLang,1,1,6, ref nPageCount);
        rptContent.DataSource = dtbStatic;
        rptContent.DataBind();
        rptTab.DataSource = dtbStatic;
        rptTab.DataBind();
     }

    protected void rptTab_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if ((e.Item.ItemType != ListItemType.Header) && (e.Item.ItemType != ListItemType.Footer))
        {
            Label lblTab = (Label)e.Item.FindControl("lblTab");
            lblTab.Text =  ConvertData.ConvertToString(DataBinder.Eval(e.Item.DataItem, "PageName"));
        }
    }
    protected void rptContent_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if ((e.Item.ItemType != ListItemType.Header) && (e.Item.ItemType != ListItemType.Footer))
        {
            Literal ltrContent = (Literal)e.Item.FindControl("ltrContent");
            ltrContent.Text = ConvertData.ConvertToString(DataBinder.Eval(e.Item.DataItem, "PageContent"));
        }
    }
}